/********************************
 * Robinson Matrix Algorithm
 *
 * Copyright (C) 2009 CNRS
 * Author : Florent AVELLANEDA, Eugen CEPOI
 * 
 *
 * All rights reserved.
 *
 *   This file is part of Robinson Matrix Algorithm.
 *
 *   Robinson Matrix Algorithm is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Robinson Matrix Algorithm is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Robinson Matrix Algorithm.  If not, see <http://www.gnu.org/licenses/>.
 *
 ***********************************************************************************/
#ifndef CLAUSE_TXE5OUP

#define CLAUSE_TXE5OUP

#include <set>
#include <iostream>
#include <sstream> 

namespace SAT
{
    class Var;
    class SAT;

    class Clause
    {
        friend class SAT;

        public:
        Clause ( );
        virtual ~Clause ();

        void afficher();

        Clause operator! () const;
        Clause operator* (const Clause &c) const;
        Clause operator* (Var &v) const;
        Clause operator+ (const Clause &c) const;
        Clause operator+ (Var &v) const;


        protected:
        std::set< std::set< std::pair< Var*, bool > > > _ssData;


        private:

        void inverce( std::set< std::set< std::pair<Var*, bool> > >::iterator begin, std::set< std::set< std::pair<Var*, bool> > >::iterator end, std::set< std::pair<Var*, bool > > result );



    };

    Clause operator! (Var &v);
    Clause operator+ (Var &v1, Var &v2);
    Clause operator* (Var &v1, Var &v2);

    Clause operator+ (Var &v, const Clause &c);
    Clause operator* (Var &v, const Clause &c);
}

#endif /* end of include guard: CLAUSE_TXE5OUP */
